import axios from 'axios'
import frame from './frame'
axios.defaults.withCredentials = true
// axios.defaults.timeout = 10000
axios.interceptors.response.use(
  response => {
    return response
  },
  error => {
    return Promise.reject(error)
  }
)

// 添加响应拦截器
axios.interceptors.response.use(
  response => {
    return response
  },
  error => {
    if (error.response) {
      switch (error.response.status) {
        case 500:
          console.log('服务器响应状态码500')
          break
        default:
      }
    }
    return Promise.reject(error)
  }
)

export default {
  frame
}
